package com.adaxi.adc.business.vehicletrip.mapper;

import com.adaxi.adc.business.vehicletrip.pojo.VehicleTrip;
import com.adaxi.adc.business.vehicletrip.vo.MyTripVo;
import com.adaxi.adc.business.vehicletrip.vo.VehicleTripVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


/**
 * @author 钟红树
 */
public interface VehicleTripMapper extends BaseMapper<VehicleTrip> {


    @Insert("insert into adc_vehicle_trip(id,vehicle_id,name,username,phone,vehicle_license,start_time,start_date,num_passengers,max_seat_capacity,status,vehicle_route_id) " +
            "values (#{id},#{vehicle_id}, #{name},#{username},#{phone},#{vehicle_license},#{start_time},#{start_date},#{num_passengers},#{max_seat_capacity},#{status},#{vehicle_route_id})")
    void insert(VehicleTripVo vo);




    List<MyTripVo> getMyTrip(Long id);

    //根据行程id修改status
    @Update("UPDATE adc_vehicle_trip SET status = #{status} WHERE id = #{id}")
    void updateStatusById(String id, String status);
}




